<%@page import="java.text.SimpleDateFormat"%>
<%@page import="com.netistate.pojo.Project"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/common.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/plugin/msgbox/msgbox.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jsp/labor/labor.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jsp/project/project.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/plugin/calendar/Calendar.js"></script>
<div class="minWin">
	<form method="post" action="#" id="myForm">
		<table>
			<tbody><tr>
				<td title="项目名称">项目名称：</td>
				<td>
					<select style="width: 140px;" name="projectNameId" id="projectNameId">
					  <% List<Project> projectList = (List<Project>)request.getSession().getAttribute("allProjectListInLabor");
					  
					  	 Project selectedProject = (Project)request.getSession().getAttribute("selectedProject");
					  	 String selectedProjectProcess = (String)request.getSession().getAttribute("selectedProjectProcess");
					  	 String selectedSection = (String)request.getSession().getAttribute("selectedSection");
					  	 
					  	 if(selectedProject == null){
					  	 	 for(Project p : projectList){%>
					  	 	 <option value="<%=p.getId() %>" title="<%=p.getProjectName() %>"><%=p.getProjectName() %></option>
					  	 <%}
					  	 }else{
					  	 	for(Project p : projectList){%>
					  	 	 <option value="<%=p.getId() %>" <%=selectedProject.getProjectName().equals(p.getProjectName())?"selected='selected'":"" %> title="<%=p.getProjectName() %>"><%=p.getProjectName() %></option>
					  	 <%}}%>
					</select>
				</td>
			</tr>
			<tr>
				<td title="项目阶段">项目阶段：</td>
				<td>
					<select id="projectProcess" name="projectProcess">
						<%if(selectedProjectProcess == null){%>
						<option value="售前">售前</option>
				  	 	<option value="已签单">已签单</option>
					   	<option value="实施">实施</option>
					   	<option value="已验收">已验收</option>
					   	<option value="停滞">停滞</option>
						<%} else if("售前".equals(selectedProjectProcess)) { %>
						<option value="售前" selected="selected">售前</option>
					   	<option value="已签单">已签单</option>
					   	<option value="实施">实施</option>
					   	<option value="已验收">已验收</option>
					   	<option value="停滞">停滞</option>
						<%} else if("已签单".equals(selectedProjectProcess)) { %>
						<option value="售前" >售前</option>
					   	<option value="已签单" selected="selected">已签单</option>
					   	<option value="实施">实施</option>
					   	<option value="已验收">已验收</option>
					   	<option value="停滞">停滞</option>
						<%} else if("实施".equals(selectedProjectProcess)) { %>
						<option value="售前" >售前</option>
					   	<option value="已签单" >已签单</option>
					   	<option value="实施" selected="selected">实施</option>
					   	<option value="已验收">已验收</option>
					   	<option value="停滞">停滞</option>
						<%} else if("已验收".equals(selectedProjectProcess)) { %>
						<option value="售前" >售前</option>
					   	<option value="已签单" >已签单</option>
					   	<option value="实施" >实施</option>
					   	<option value="已验收" selected="selected">已验收</option>
					   	<option value="停滞">停滞</option>
						<%} else if("停滞".equals(selectedProjectProcess)) { %>
						<option value="售前" >售前</option>
					   	<option value="已签单" >已签单</option>
					   	<option value="实施" >实施</option>
					   	<option value="已验收" >已验收</option>
					   	<option value="停滞" selected="selected">停滞</option>
						<%} %>
					</select>
				</td>
			</tr>

			<tr>
				<td title="部门类型">部门类型：</td>
				<td>
					<select id="addSection" name="section">
						<%if(selectedSection == null){ %>
						<option value="研发" title="研发">研发</option>
						<option value="技术支持" title="技术支持">技术支持</option>
						<option value="交流" title="交流">交流</option>
						<option value="销售" title="销售">销售</option>
						<%} else if("研发".equals(selectedSection)){ %>
						<option value="研发" title="研发" selected="selected">研发</option>
						<option value="技术支持" title="技术支持">技术支持</option>
						<option value="交流" title="交流">交流</option>
						<option value="销售" title="销售">销售</option>
						<%} else if("技术支持".equals(selectedSection)){ %>
						<option value="研发" title="研发" >研发</option>
						<option value="技术支持" title="技术支持" selected="selected">技术支持</option>
						<option value="交流" title="交流">交流</option>
						<option value="销售" title="销售">销售</option>
						<%} else if("交流".equals(selectedSection)){ %>
						<option value="研发" title="研发" >研发</option>
						<option value="技术支持" title="技术支持" >技术支持</option>
						<option value="交流" title="交流" selected="selected">交流</option>
						<option value="销售" title="销售">销售</option>
						<%} else if("销售".equals(selectedSection)){ %>
						<option value="研发" title="研发" >研发</option>
						<option value="技术支持" title="技术支持" >技术支持</option>
						<option value="交流" title="交流" >交流</option>
						<option value="销售" title="销售" selected="selected">销售</option>
						<%}%>
					</select>
				</td>
			</tr>
			<%
		        Date date = new Date();
			    SimpleDateFormat sdFormat = new SimpleDateFormat("yyyy-MM-dd");
			    String reportDate = sdFormat.format(date);
			    Calendar calendar = Calendar.getInstance();
			    calendar.setTime(date);
			 %>
			<tr>
				<td title="工   时">工&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;时：</td>
				<td>
					<input type="text" readonly="readonly" id="datetime" value="<%=reportDate %>" class="input3" onclick="MyCalendar.SetDate(this)" style="width: 100px" name="day" >
					<span title="用了">用了</span>
					<input type="text" style="width: 50px" id="hours">
					<span style="color:red">*</span>
					<span title="小时">小时</span>
				</td>
			</tr>
			<tr>
				<td title="是否去现场">是否去现场：</td>
				<td>
					<input type="radio" checked="" value="1" name="locale">
					<span title="是">是</span>
					<input type="radio" value="0" name="locale">
					<span title="否">否</span>
				</td>
			</tr>
			<tr>
				<td title="描   述">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述：</td>
				<td>
					<textarea id="descr" cols="28" rows="10"></textarea>
					<span style="color:red">*</span>
				</td>
			</tr>
		</tbody></table>
	</form>
</div>